package com.sale.job.service;

import com.sale.storage.api.RemoteStockInfoService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * 库存提醒定时任务类
 */
@Service
public class WmsStockInfoMessageService {

    @DubboReference
    RemoteStockInfoService remoteStockInfoService;

    @XxlJob("stockWarnHandler")
    public void stockWarnHandler() throws Exception {
        System.out.println("定时任务开始执行");
        remoteStockInfoService.maxStock();
        System.out.println("定时任务执行完毕");
    }
}
